import Vue from 'vue'
import Router from 'vue-router'
import Monitor from '../components/Monitor'
import environment from '../components/Monitornr/environment'
import safe from '../components/Monitornr/safe'
import fire from '../components/Monitornr/Fire'
import power from '../components/Monitornr/power'
import alarm from '../components/alarm'
import Chart from '../components/Chart'
import linkage from '../components/linkage'
import device from '../components/device'
import interfacea from '../components/Interface'
import system from '../components/system'
import systemversion from '../components/systemversion'
import log from '../components/log'
import contacts from "../components/contacts"
import layout from '../components/layout.vue'
import login from '../components/login.vue'
import alarmtest from '../components/alarmtest.vue'
import systemdetails from '../components/systemdetails.vue'

Vue.use(Router)
export default new Router({
  linkActiveClass: 'navactive',
  routes: [
    {
      mode: 'history',
      path:'/login',
      component:login
    },
    {
      path:'/',
      redirect:'/login',
      active:false
    },
    {
      path:'/layout',
      component:layout,
      meta: { requiresAuth: true },
      children:[
            {
        path: '/layout/Monitor',
        component: Monitor,
         active:false,
         meta: { requiresAuth: true },
         children:[
             {
                 path:'/layout',
                 redirect:'/layout/Monitor/environment',
                 meta: { requiresAuth: true }
             },
             {
                 path:'/layout/Monitor/environment',
                 component:environment,
                 meta: { requiresAuth: true }
            },
             {
                 path:'/layout/Monitor/safe',
                 component:safe,
                 meta: { requiresAuth: true }
             },
             {
                 path:'/layout/Monitor/fire',
                 component:fire,
                 meta: { requiresAuth: true }
             },
             {
                 path:'/layout/Monitor/power',
                 component:power,
                 meta: { requiresAuth: true }
             }
         ]
       },
     {
         path: '/layout/alarm',
         component: alarm,
         active:false,
         meta: { requiresAuth: true }
       },
     {
         path: '/layout/Chart',
         component: Chart,
         active:false,
         meta: { requiresAuth: true }
       },
    {
        path: '/layout/linkage',
        component: linkage,
        active:false,
        meta: { requiresAuth: true }
      },
    {
        path: '/layout/device',
        component: device,
        active:false,
        meta: { requiresAuth: true }
      },
      {
        path: '/layout/interfacea',
        component: interfacea,
        active:false,
        meta: { requiresAuth: true }
      },
    {
        path: '/layout/system',
        component: system,
        active:false,
        meta: { requiresAuth: true }
      },
      {
        path: '/layout/systemversion',
        component: systemversion,
        active:false,
        meta: { requiresAuth: true }
      },
      {
        path: '/layout/log',
        component: log,
        active:false,
        meta: { requiresAuth: true }
      },
      {
          path: '/layout/contacts',
          component: contacts,
          active:false,
          meta: { requiresAuth: true }
      },
      {
          path: '/layout/alarmtest',
          component: alarmtest,
          active:false,
          meta: { requiresAuth: true }
      },
      {
          path: '/layout/systemdetails',
          component: systemdetails,
          active:false,
          meta: { requiresAuth: true }
      }
      ]
    }
  ]
})

